import axios from "@/util/request";

export default {
    findProduct() {
        return axios.request({
            url: axios.productRoute+'/product/findAll',
            method: 'get',
        })
    },
    findProductById(id) {
        return axios.request({
            url: axios.productRoute+`/product/findById/?id=${id}`,
            method: 'get',
        })
    },
    // 3. 条件查询带分页
    search(page,pageSize,data){
        return axios.request({
            url: axios.productRoute+`/product/conditionFindByPage?page=${page}&pageSize=${pageSize}`,
            method: 'post',
            data
        })
    },
    // 4. 保存学生
    save(data){
        return axios.request({
            url: axios.productRoute+'/product/addOrder',
            method: 'post',
            data
        })
    },
    update(data){
        return axios.request({
            url: axios.productRoute+'/product/updateOrder',
            method: 'post',
            data
        })
    },
    deleteByIds(data){
        return axios.request({
            url: axios.productRoute+`/product/batchDeleteOrder`,
            method: 'post',
            data
        })
    },
}
